HTML Lecture 3


Setting the color attribute of links

Have you ever notice a hyperlink's color? Maybe Blue? Or have you ever wondered why the LINK is another color after you have visited the linked page? Burgandy? What about when you click on the hyperlink, do you notice how it changes color. Your browser has a set of default colors, LINK is blue, VLINK is burgandy and ALINK is red. So, what is LINK, VLINK, and ALINK?

LINK is just a regular, never before visited link by default is blue
VLINK is a previously viewed link, by default is brgandy and
ALINK is an active link ("The color when you click on it"), which is usually red by default. Any or all of these three options can be omitted, of course.

So, why do we want to change the color, when windows does it for us. To be different.


Adding images to your pages

Images can be used to make your Web pages distinctive and greatly help to get your message across. The simple way to add an image is using the <img> tag. Let's assume you have an image file called "david.jpg" in the same folder/directory as your HTML file.

<img src="david.jpg" width="239" height="393" >

The width and height aren't strictly necessary but help to speed the display of your Web page. But hey, something is still missing! What about those people who can't see the image. How do you provide a description of image to them. You can add a short description to <img> tag

<img src="david.jpg" width="239" height="393" alt="Artwork provided by my friend David">

View

The alt attribute is used to give the short description, in this case "Artwork provided by my friend David". For complex images, you may need to also give a longer description.

You can create images in a number of ways, with a digital camera, by scanning in an image, or creating an image with some type of graphic program. Most browsers recognize gif and jpg image extensions.

Note: To avoid long delays while the image is downloaded over the network, you should avoid using large image files.


Linking to other pages

What makes the Web so effective is the ability to link from one page to another with the click of a button. A single click can take you anywhere in the world!

Links are defined with the <a> tag. Lets define a link to the page defined in the file "max.html":

This a link to a file called david.htm
<a href="david.htm">David's Drawings</a>.

The text between the <a href> and the </a> is used as the caption for the link. It is common for the caption to be in blue underlined text (HyperLink).

To link to a page on another Web site you need to give the full Web address (commonly called a URL), for instance to link to our webpage you need to write:

This is a link to <a href="http://campus.fortunecity.com/duke/281">CIS 172</a>.